From 3a2f364c9502c077181f1dcb8131155b9e005b00 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 27 Mar 2020 12:01:50 +0000 Subject: Merge #4552 commit 28654b1f42a98c0f9910e333a9c8074fe30aff24 Author: Alexander Harkness Date: Fri Mar 27 11:58:34 2020 +0000 Remove whitespace commit f1492e174b51e168bf4fb150c2d7b7096c393057 Author: Odin Date: Fri Mar 27 04:30:32 2020 +1100 Add issue comment commit b64166d68a327e8a9bf80720ff6e9c6af93921b5 Author: Odin Date: Fri Mar 27 03:42:35 2020 +1100 Don't run OnBroken with pistons Stops piston duplication bug and doesn't break water and lava simulation --- src/ChunkMap.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index 6edcf3d54..9c721610e 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -639,7 +639,14 @@ void cChunkMap::SetBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE NIBBLETYPE blockMeta; GetBlockTypeMeta(a_BlockPos, blockType, blockMeta); cChunkInterface ChunkInterface(this); - BlockHandler(blockType)->OnBroken(ChunkInterface, *m_World, a_BlockPos, blockType, blockMeta); + + // Hotfix for https://github.com/cuberite/cuberite/issues/4468 + // Should be removed when a proper fix is found. + if ((blockType != E_BLOCK_PISTON) && (blockType != E_BLOCK_STICKY_PISTON) && (blockType != E_BLOCK_PISTON_EXTENSION)) + { + BlockHandler(blockType)->OnBroken(ChunkInterface, *m_World, a_BlockPos, blockType, blockMeta); + } + chunk->SetBlock(relPos, a_BlockType, a_BlockMeta); m_World->GetSimulatorManager()->WakeUp(a_BlockPos, chunk); BlockHandler(a_BlockType)->OnPlaced(ChunkInterface, *m_World, a_BlockPos, a_BlockType, a_BlockMeta); -- cgit v1.2.3